package o;

import android.content.res.ColorStateList;
import android.view.View;
import com.huawei.appgallery.foundation.ui.framework.widget.button.DownloadButton;
import huawei.widget.HwDownLoadWidget;
import java.lang.reflect.Field;

public class ehn extends SkinAttr {

    static class d extends fkz<SkinAttr, ColorStateList> {
        DownloadButton ˎ;

        public /* synthetic */ void ॱ(Object obj) {
            ˏ((ColorStateList) obj);
        }

        public d(DownloadButton downloadButton) {
            this.ˎ = downloadButton;
        }

        public void ˏ(ColorStateList colorStateList) {
            if (this.ˎ != null) {
                Logger.ˏ("DownloadButtonDowningTextColorAttr", "setDowningTextColor");
                try {
                    Field declaredField = HwDownLoadWidget.class.getDeclaredField("ʼ");
                    declaredField.setAccessible(true);
                    declaredField.set(this.ˎ, colorStateList);
                } catch (Exception e) {
                    Logger.ˋ("DownloadButtonDowningTextColorAttr", "field error : " + e.toString());
                }
                if (this.ˎ.ॱˊ() == 1) {
                    this.ˎ.ˊॱ().setTextColor(colorStateList);
                }
            }
        }
    }

    public void ˎ(View view, boolean z) {
        if (view instanceof DownloadButton) {
            DownloadButton downloadButton = (DownloadButton) view;
            if ("color_state_list".equals(this.attrValueTypeName) || "color".equals(this.attrValueTypeName)) {
                this.ʽ = "color_state_list";
                fks.ˎ(view.getContext(), this, new d(downloadButton)).ॱ(z);
            }
        }
    }
}
